# import numpy as np
# x = np.empty((3, 2), dtype = int)
# print (x)

# import numpy as np
#
# # 默认为浮点数
# x = np.zeros(5)
# print(x)
#
# # 设置类型为整数
# # (5, )一维int，(1, 5)二维int
# y = np.zeros((5,), dtype=int)
# print(y)
#
# # 自定义类型
# z = np.zeros((2, 2), dtype=[('x', 'i4'), ('y', 'f4')])
# print(z)

# import numpy as np
#
# # 默认为浮点数
# x = np.ones(5)
# print(x)
#
# x = np.ones((2, 2), dtype=int)
# print(x)
#
# x = np.ones((2, 2), dtype=[('x', 'f4'), ('y', 'i4')])
# print(x)

# 从已有数组创建新数组
import numpy as np

x = [1, 2, 3]
a = np.array(x)
print(a)